
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="java.util.ArrayList,
                 com.scalar.chiptrack.utils.ConfigManager,
                 com.scalar.chiptrack.users.Functionality,
                 com.scalar.chiptrack.users.User,
                 com.scalar.chiptrack.sales.CustomerPartNumber,
                 com.scalar.chiptrack.commons.Constants"%>

<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/chiptrack-tags.tld" prefix="chiptrack" %>

<chiptrack:checkLogon sourcePage="/endUserPartNumbers.do"/>

<html:html locale="true">

<%String chipTracContext = "/" + ConfigManager.getChipTracContext();%>

<HEAD><TITLE>Scalarsoft - ChipTrac</TITLE>
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<LINK href="<%=chipTracContext%>/jsp/includes/stylesheets/scalarsoft.css" type=text/css rel=stylesheet>

<script src="<%=chipTracContext%>/jsp/includes/scripts/validations.js">
</script>


<script language='javascript'>
var saved = false;
function save()
{

      //Added by Sarada on 10th Feb 2004
        var mfgPartNo = eval('document.customerPartNumbersForm.manufacturingPartNo');
        if (mfgPartNo.length ==  null )
        {
            mfgPartNo.disabled = false;
        }
        else
        {
          for (var k = 0; k < mfgPartNo.length; k++ )
            {
                mfgPartNo[k].disabled = false;
            }
         }
    if( saved == false )
    {
        saved = true;
        document.customerPartNumbersForm.submit();
    }
}


function reset()
{
    document.customerPartNumbersForm.reset();
}
function closeWindow(form) {
	// window.opener.navigate(window.opener.document.location.href);

  //  form = window.opener.customerForm;
   // form.submit();
    window.close();
}

</script>

<META content="MSHTML 5.50.4807.2300" name=GENERATOR></HEAD>
<BODY bgColor='#ffffff' leftMargin=0 topMargin=0 marginheight="0" marginwidth="0">

<!-- from here your body starts -->

<html:form name="customerPartNumbersForm" type="com.scalar.chiptrack.sales.forms.CustomerPartNumbersForm" action="/endUserPartNumbers.do?action=SaveEndUserPartNumbers">


<center><span class="NArialW">
<!-- Modified by veeru on (03/03/04)
Customer Part Numbers -->
<%-- <bean:message key="label.customerPartNumber"/> --%>
End User Part Numbers
</span></center>
<img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=20>
<table border="0" width="90%" align=right>
 <tr><td>
 <table border="0" width="100%" cellspacing='10' cellpadding='2' align='left'>
 <tr><td colspan='5' align=right><a href="javascript:closeWindow(document.customerPartNumbersForm);" onMouseOver="window.status='Click here to close this window';return true" onmouseout="window.status='';return true"><font class='NArialL'>Close this window</font></a></td></tr>
 <tr><td colspan='5'><chiptrack:errors styleClass='NArialL' /></td></tr>
 <tr><td colspan='5'><chiptrack:info styleClass='NArialL' /> </td></tr>
 </table>
 </td></tr>
 <tr><td>
   <table border="0" width="50%" bordercolor="black" align="center">
   <!--tr><td colspan='5'></td></tr-->
    <tr>
        <td colspan='1' align="center" bgcolor="#993333"><font class="NArialL">
			<!-- Modified by veeru on (03/05/04)
			<font color="#FFFFFF">Mfg Part Number</font> -->
			<font color="#FFFFFF"><bean:message key="label.mfgPartNumber" /></font>
			</font>
		</td>
        <td colspan='1' align="center" bgcolor="#993333"><font class="NArialL"><font color="#FFFFFF">
		<!-- Modified by veeru on (03/08/04) -->
		End User Part Number
		<%-- <bean:message key="label.customerPartNumber"/> --%>
		</font></font></td>

        <%if(Constants.CLIENT_NAME_AIRGO.equalsIgnoreCase(ConfigManager.getClientNameAirgo() )){ %>
        <td colspan='1' align="center" bgcolor="#993333"><font class="NArialL"><font color="#FFFFFF">
        <bean:message key="label.labelNumber" />
		</font></font></td>
        <%}%>

    </tr>

    <% int bgcount = 0;%>
    <logic:iterate id="CustomerPartNumber" name="mfgPartsWithProductIds" type="com.scalar.chiptrack.sales.CustomerPartNumber">
    <% bgcount = bgcount + 1; %>


    <%  int lineitemid =CustomerPartNumber.getProductId();
    if(lineitemid == 0 ){
    int colSpan = 2;
    if(Constants.CLIENT_NAME_AIRGO.equalsIgnoreCase(ConfigManager.getClientNameAirgo() )){
        colSpan = 3;
    }
    %>
    <tr>
        <td align="center"  colspan=<%=colSpan%> bgcolor='#FFFFEE'><font class="NArialL">
        <html:text name="CustomerPartNumber" property="manufacturingPartNo" size="23" styleClass="txfield" disabled="true"/></font></td>
        <td align="center"  colspan=<%=colSpan%> bgcolor='#FFFFEE'><font class="NArialL"></font></td>
        <html:hidden name="CustomerPartNumber" property="customerPartNo" />
        <html:hidden name="CustomerPartNumber" property="labelNumber"/>
         <input type="hidden" name="productId" value="<%=CustomerPartNumber.getProductId()%>"/> </td>
        </tr>
       <% } else{%>
    <tr>
    <td nowrap   colspan='1' align="center" bgcolor='#FFFFEE'><font class="NArialL">
    <!--input type="hidden" name="productId" value="<%= CustomerPartNumber.getProductId()%>"/-->
    <html:text name="CustomerPartNumber" property="manufacturingPartNo" size="23" styleClass="txfield" disabled="true"/></font></td>
    <td nowrap  colspan='1' align="center"  bgcolor='#FFFFEE'><font class="NArialL">
    <html:text name="CustomerPartNumber" property="customerPartNo" size="23" styleClass="txfield"  maxlength="50"/> </font>
      <input type="hidden" name="productId" value="<%=CustomerPartNumber.getProductId()%>"/></td>
    <%if(Constants.CLIENT_NAME_AIRGO.equalsIgnoreCase(ConfigManager.getClientNameAirgo() )){%>
    <td nowrap   colspan='1' align="center" bgcolor='#FFFFEE'><font class="NArialL">
    <html:text name="CustomerPartNumber" property="labelNumber" size="23" styleClass="txfield" maxlength="50"/></font></td>
    <%}else{%>
    <html:hidden name="CustomerPartNumber" property="labelNumber"/>
    <%} } %>

    </tr>
    </logic:iterate>
    <tr>&nbsp;&nbsp;</tr>

    <!--tr><td class="NArialL" ><IMG src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=50></td></tr-->
    <!--tr>
        <td  nowrap align='center'>
		     <a href="javascript:save()"><img border="0" src="<%=chipTracContext%>/jsp/includes/images/save.gif" width="53" height="17"></a>
	    </td>
		<td  nowrap align='left'>
		     <a href="javascript:reset()"><img border="0" src="<%=chipTracContext%>/jsp/includes/images/reset.gif" width="53" height="17"></a>
	    </td>
    </tr-->
    <!--tr><td  align=center><a href="javascript:closeWindow(document.customerPartNumbersForm);" onMouseOver="window.status='Click here to close this window';return true"><font class='NArialL'>Close this window</font></a></td></tr-->

    </table>



</td></tr>
  <tr>
        <td  nowrap colspan='1' align='center'>
            <%-- Commented by Krishna Prasad on 20 May 2004, due to improper submition of form --%>
		     <%--<a href="javascript:save()"><img border="0" src="<%=chipTracContext%>/jsp/includes/images/save.gif" width="53" height="17"></a>--%>
             <%-- Added by Krishna Prasad on 20 May 2004, due to above commented tag is not submiting the form properly--%>
             <input type="image" onClick="javascript:save()" border="0" src="<%=chipTracContext%>/jsp/includes/images/save.gif" width="53" height="17" onmouseover="window.status='Click to Save End User Part Number';return true" onmouseout="window.status='';return true"title="Click here to Save End User Part number">

	    <!--/td>
		<td  nowrap colspan='1' align='left'-->
		    &nbsp;&nbsp;&nbsp;&nbsp; <a href="javascript:reset()"><img border="0" src="<%=chipTracContext%>/jsp/includes/images/reset.gif" width="53" height="17" onmouseover="window.status='Click to Reset';return true" onmouseout="window.status='';return true"title="Click here to Reset"></a>
	    </td>
    </tr>
<tr><td colspan='5' align=center><a href="javascript:closeWindow(document.customerPartNumbersForm);" onMouseOver="window.status='Click here to close this window';return true" onmouseout="window.status='';return true"><font class='NArialL'>Close this window</font></a></td></tr>
</table>
<%
    String endUserId = request.getParameter("endUserId");
%>
<input type="hidden" name="bgCount" value="<%=bgcount%>">
<input type="hidden" name="endUserId" value="<%=endUserId%>">
</html:form>


</body>

</html:html>